与Dev c+的链接问题+;和Boost::regex
我在DeV C++中使用了Boost库,特别是正则表达式。我尝试使用他们的示例代码:
#include string
#include iostream
using namespace boost;
regex expression("([0-9]+)(\\-| |$)(.*)");
// process_ftp:
// on success returns the ftp response code, and fills
// msg with the ftp response message.
int process_ftp(const char* response, std::string* msg)
{
cmatch what;
if(regex_match(response, what, expression))
{
// what[0] contains the whole string
// what[1] contains the response code
// what[2] contains the separator character
// what[3] contains the text message.
if(msg)
msg->assign(what[3].first, what[3].second);
return std::atoi(what[1].first);
}
// failure did not match
if(msg)
msg->erase();
return -1;
}
#包含字符串
#包括iostream
使用名称空间boost;
正则表达式(([0-9]+)(\\-| |$)(.*);
//进程(ftp):
//成功时返回ftp响应代码,并填充
//带有ftp响应消息的消息。
int process_ftp(常量字符*响应,标准::字符串*消息)
{
cmatch什么;
if(正则表达式匹配(响应、内容、表达式))
{
//什么[0]包含整个字符串
//[1]中包含的响应代码是什么
//什么[2]包含分隔符字符
//[3]包含文本消息的内容。
如果(味精)
msg->assign(什么[3]。第一,什么[3]。第二);
返回std::atoi(what[1]。first);
}
//失败并不匹配
如果(味精)
msg->erase();
返回-1;
},c++,boost,C++,Boost,它给我的错误是:
[Linker error]未定义对“boost::re_detail::get_mem_block()”的引用
以及许多其他链接器错误。我似乎找不到修复它的方法,即使在搜索这个问题时,我遇到了其他编译器。我已经为其他头文件向项目添加了include路径
我该怎么绕过它?如果我必须在DevC++编译的过程中更改某些内容,是从文件选项卡还是参数选项卡?
另外,在一个不太不同的方面,有人能给我推荐一个关于编译器的好指南或页面和/或一些可以帮助我的东西吗?(因为我在C++页面中找不到
|